﻿using personalplaner.common;
using personalplaner.common.mvvm.factory;
using personalplaner.servicemodel.dataaccess;

namespace personalplaner.gui.plugins.dienstplan.viewmodels.factories
{
    public class DienstPlanPluginModelFactory : IFactory
    {
        public object CreateViewModel(System.Windows.DependencyObject sender)
        {
            var vm = new DienstPlanPluginViewModel(sender);

            vm.ServiceLocator.RegisterService<IDiensteDataAccess>(new DiensteDataAccess(SettingsProvider.Settings));
            vm.ServiceLocator.RegisterService<IPlanDataAccess>(new PlanDataAccess(SettingsProvider.Settings));

            return vm;
        }
    }
}
